package library.service.impl;

import library.config.MySqlSessionFactory;
import org.apache.ibatis.session.SqlSession;
import javax.annotation.Resource;
import library.po.Identity;
import library.mapper.IdentityMapper;
import library.service.IdentityService;
public class IdentityServiceImpl implements IdentityService{

    @Resource
    private SqlSession sqlSession;
    private IdentityMapper identityMapper;

    IdentityServiceImpl(){
        sqlSession = MySqlSessionFactory.getSqlSessionInstance();
        identityMapper = sqlSession.getMapper(IdentityMapper.class);
    }

    @Override
    public int deleteByType(Integer type) {
        return identityMapper.deleteByType(type);
    }

    @Override
    public int insert(Identity record) {
        return identityMapper.insert(record);
    }

    @Override
    public int insertSelective(Identity record) {
        return identityMapper.insertSelective(record);
    }

    @Override
    public Identity selectByType(Integer type) {
        return identityMapper.selectByType(type);
    }

    @Override
    public int updateByTypeSelective(Identity record) {
        return identityMapper.updateByTypeSelective(record);
    }

    @Override
    public int updateByType(Identity record) {
        return identityMapper.updateByType(record);
    }

}
